package com.hirsi.common.db.developer.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 开发者产品表
 * </p>
 *
 * @author 封夕
 * @since 2023-10-25
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("ztk_developer_product")
public class DeveloperProduct extends Model<DeveloperProduct> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 产品id
     */
    @TableField("product_id")
    private Integer productId;

    /**
     * 到期时间：为空是永久
     */
    @TableField("expire_time")
    private LocalDateTime expireTime;

    /**
     * 是否试用版：0-否，1-是
     */
    @TableField("is_trial")
    private Boolean isTrial;

    /**
     * 是否免费版：0-否，1-是
     */
    @TableField("is_free")
    private Boolean isFree;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 最后更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 开发者编码
     */
    @TableField("developer_code")
    private String developerCode;

    /**
     * 逻辑删除字段：0-未删除，null-已删除
     */
    @TableField("deleted")
    private Boolean deleted;

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
